GH-121970: Extract pydoc_topics into a new extension#129116
Merged
AA-Turner merged 8 commits intopython:mainfrom Jan 21, 2025
Merged
GH-121970: Extract pydoc_topics into a new extension#129116AA-Turner merged 8 commits intopython:mainfrom
pydoc_topics into a new extension#129116AA-Turner merged 8 commits intopython:mainfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This also simplifies the
pydoc-topicsbuilder. Grouping the topic labels by docname improves the speed of topics generation from ~68s to ~57s (19% faster) from a cold state, and from ~13s to ~3.4s (3.8x faster) when re-using the pickled documents.The representation of
topics.pyalso changes from the defaultpprint.pformatoutput of:to a simpler representation using triple single quotes (save for when
'''appears in the body):This representation is both nicer to read and is 63% of the file size of the current
topics.py(518KB vs 830KB). Line count also decreases from 17,486 to 12,782.Tested by running:
The
'formatstrings'change is trailing whitespace on the>>> for num in range(5,12):line:The 'debugger' change is
"Ctrl-C"to"Ctrl"-"C", but I'm not sure what caused this:cc @hugovk as 3.14 release manager as this does change the format of
Lib/pydoc_data/topics.py. I'm happy when doing backports to preserve the current format (pformat) if release managers would prefer.A
pyspecific#121970📚 Documentation preview 📚: https://cpython-previews--129116.org.readthedocs.build/